<form action="index.php?app=tags&ctl=admin_tags&act=saveGoods" id="tag-form" method="POST">
<div class="division">
<table>
    <tr>
        <td>标签名：</td>
        <td>
            <{$tag.tag_name}>
        </td>
    </tr>
    <tr>
        <td>商品编号：
        </td>
        <td>
            <{input type="textarea" name="goods_bns" cols="30" rows="10" }>
            <br/>
            (*每行输入一个编号)
        </td>
    </tr>
    <input type="hidden" name="tag_id" value="<{$tag_id}>">
 </table>
</div>

<div id="save_message"></div>

<div class="table-action">
	<button class="btn" type="button" id="tag-form-submit"><span><span><{t}>保存<{/t}></span></span></button></div>
</form>

<script>
(function(){
	var _form = $('tag-form');
	var btn =$('tag-form-submit');
	var finder = finderGroup['<{$finder_id}>'];
    
    btn.addEvent('click', function(){
        new Request({
            url : 'index.php?app=tags&ctl=admin_tags&act=saveGoods',
            method : 'post',
            onSuccess : function(responseText){
                //alert(responseText);
                $('save_message').set('html', responseText);
            }
        }).send(_form);
    });
	
	_form.store('target',{
		
		onSuccess:function(response){
			var hash_res_obj = JSON.decode(response);
			if (hash_res_obj.success != undefined && hash_res_obj.success != "")
			{
				try{
					var _dialogIns = btn.getParent('.dialog').retrieve('instance');
				}catch(e){}
				
				if(_dialogIns)
				{	
					_dialogIns.close();
					finder.refresh();
				}
			}	
		}
	});
	
})();
		
</script>